<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
    function Point(x,y){
       this.x=x;
       this.y=y;
       this.moveTo=function(x,y){
        this.x=x;
        this.y=y;
        console.log(this.x+","+this.y);
        //1,1
        //10,10
       }
    }
    var p1=new Point(0,0);
    var p2={x:0,y:0};
    p1.moveTo(1,1);
    p1.moveTo.apply(p2,[10,10]);
    </script>
</body>
</html>